home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7728 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.7 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: What is &Variable (declared as: char Var
  5. Date: Wed, 28 Feb 96 13:28:11 GMT
  6. Organization: none
  7. Message-ID: <825514091snz@genesis.demon.co.uk>
  8. References: <13b_9602272020@amphigory.com>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <13b_9602272020@amphigory.com> Pazuzu@amphigory.com "Pazuzu" writes:
  15.  
  16. >myarray may not be a pointer (actually, it IS, but for the sake of argument...)
  17. >but EVERYTHING, EVERYTHING, EVERYTHING has a memory address (otheriwise, it
  18. >ain't in memory!), and &<identifier> gives you its address.  myarray IS a
  19. >pointer. All arrays are pointers.
  20.  
  21. False - arrays and pointers are two entirely different things. To qualify
  22. what you say all objects and functions have a memory address and an array
  23. is an object. An array happens to be a compound object made up of a contiguous
  24. group of smaller (well you can have a 1 element array) objects i.e. its
  25. elements. Like all other objects an array has an address and each of its
  26. elements has an address. There just happens to be a shorthand syntax
  27. to take the address of an array's elements e.g. &myarray[0] can be written
  28. simply as myarray. That's not saying that myarray is a pointer any more than
  29. i is a pointer in int i; however both have addresses and therefore pointer
  30. (rvalues) to each can be generated.
  31.  
  32. -- 
  33. -----------------------------------------
  34. Lawrence Kirby | fred@genesis.demon.co.uk
  35. Wilts, England | 70734.126@compuserve.com
  36. -----------------------------------------
  37.